<template>
  <div>
    <el-tabs type="border-card" @tab-change="tabChange" v-model="activeName">
      <el-tab-pane :lazy="true" name="团队专题" label="团队专题">
        <router-view name="teamQuestionBank"></router-view>
      </el-tab-pane>
      <el-tab-pane :lazy="true" name="我的专题" label="我的专题">
        <router-view name="myQuestionbank"></router-view>
        <router-view name="chgMyQuestionbank"></router-view>
      </el-tab-pane>
    </el-tabs>
  </div>
  <!-- <Questiontable></Questiontable> -->
</template>
<script setup lang="ts">
import { computed, onMounted, ref } from "vue";
import { useRoute, useRouter } from "vue-router";
import { useStore } from "vuex";
import { Storekey } from "../../../interface";
import Studycodemodel from "../../../mysql_interface/studycodemodel";

const store = useStore(Storekey)
const user = computed<Studycodemodel.Iuser>(() => {
  return store.getters.getuser;
});
const teamId = computed(() => {
  return user.value?.teamid
})
const router = useRouter()
const route = useRoute()

const activeName = ref("团队专题")

onMounted(() => {
  start()
})
async function start() {
  tabChange(activeName.value)
}

// 跳转
function tabChange(name: string) {
  router.push({ name: name, });
}

</script>

<style scoped>
.router-link-active {
  color: cadetblue;
}
</style>